package com.lxy.digitaltwins.controller;


import com.lxy.digitaltwins.domain.vo.DataVO;
import com.lxy.digitaltwins.domain.vo.ThermometerVO;
import com.lxy.digitaltwins.service.EquipmentService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import io.swagger.annotations.Api;
@Api(tags = "设备数据接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/equipment")
public class EquipmentController {
    private final EquipmentService equipmentService;

    @ApiOperation("获取温度计数据")
    @GetMapping("/getThermometer")
    public ThermometerVO getThermometer() throws Exception {
        return equipmentService.getThermometer();
    }

    @ApiOperation("获取传感器数据")
    @GetMapping("/getSensorDate")
    public DataVO getSensorDate(@RequestParam("name") String name) throws Exception {
        return equipmentService.getSensorDate(name);
    }
}
